<extend name="Layout/ins_page" />
<block name="content">
	<style>
		.table tbody > tr > td {
			font-size: 8px;
			margin: 0px;
			padding: 0px;
			padding-top: 3px;
			padding-bottom: 3px;
		}
		.table div {
			margin: 0px;
			padding: 0px;
		}
		.table p {
			margin: 0px;
			padding: 0px;
		}
	</style>
	<div class="page-header clearfix">
		<h1 class="col-sm-8">工单统计</h1>
		<div class="col-sm-4">
			<a style="margin-left: 10px;" href="{:U('report',array('offset'=>$next_offset))}" class="btn btn-primary btn-sm pull-right">下一周</a>
			<a href="{:U('report',array('offset'=>$prev_offset))}" class="btn btn-primary btn-sm pull-right">上一周</a>
		</div>
	</div>
	<div class="table-responsive">
		<table class="table table-bordered">
			<tr class="text-center">
				<td class="col-8 ">日期</td>
				<td class="col-30 " colspan="3">{$day_1} (周一)</td>
				<td class="col-30 " colspan="3">{$day_2} 周二</td>
				<td class="col-30 " colspan="3">{$day_3} 周三</td>
				<td class="col-30 " colspan="3">{$day_4} 周四</td>
				<td class="col-30 " colspan="3">{$day_5} 周五</td>
				<td class="col-30 week_end" colspan="3">{$day_6} 周六</td>
				<td class="col-30 week_end" colspan="3">{$day_7} 周日</td>
				<td class="col-2" rowspan="{:count($list)+2}"><a onclick="switch_week_end()">显示<br>/<br>隐藏</a></td>
			</tr>
			<tr class="text-center">
				<td class="col-8 "></td>
				<td>上午</td><td>下午</td><td>下午</td>
				<td>上午</td><td>下午</td><td>下午</td>
				<td>上午</td><td>下午</td><td>下午</td>
				<td>上午</td><td>下午</td><td>下午</td>
				<td>上午</td><td>下午</td><td>下午</td>
				<td class="week_end">上午</td><td class="week_end">下午</td><td  class="week_end">下午</td>
				<td class="week_end">上午</td><td class="week_end">下午</td><td class="week_end">下午</td>
			</tr>
			<empty name="list">
				<tr class="no-data">
					<td colspan="23">没找到数据</td>
				</tr>
				<else/>
				<foreach name="list" item="vo">
					<tr>
						<td class="col-8 text-center">{$vo}</td>
						<td class="col-30 " colspan="3">
						<php>
							echo get_work_order($key,$day_1)
						</php></td>
						<td class="col-30 " colspan="3">
						<php>
							echo get_work_order($key,$day_2)
						</php></td>
						<td class="col-30 " colspan="3">
						<php>
							echo get_work_order($key,$day_3)
						</php></td>
						<td class="col-30 " colspan="3">
						<php>
							echo get_work_order($key,$day_4)
						</php></td>
						<td class="col-30 " colspan="3">
						<php>
							echo get_work_order($key,$day_5)
						</php></td>
						<td class="col-30 week_end" colspan="3">
						<php>
							echo get_work_order($key,$day_6)
						</php></td>
						<td class="col-30 week_end" colspan="3">
						<php>
							echo get_work_order($key,$day_7)
						</php></td>
					</tr>
				</foreach>
			</empty>
		</table>
	</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function add() {
			window.open("{:U('add')}", "_self");
		}		
		function switch_week_end(){
			$(".week_end").toggle();
		}		
		$(document).ready(function() {
			set_return_url();
			$(".week_end").toggle(false);
		});
	</script>
</block>
